﻿#ifndef IMAINFRAMESERVICE_H
#define IMAINFRAMESERVICE_H


#include <QStackedWidget>
#include <QToolBar>
#include <QToolButton>
#include <QDockWidget>
#include "idatamanager.h"

/// mainwindow 派生于该接口类，通过该服务类指针可动态转换为QMainWindow或QWidget
class IMainFrameService
{
public:
    /**
     * @brief addFrameAction 添加菜单，支持大中小三种模式
     * @param pageObjName 菜单标签名称
     * @param groupObjName 菜单组名称
     * @param action 菜单对象
     * @param mode 1:addLargeAction,2:addMediumAction,3:addSmallAction
     */
    virtual void addFrameAction(const QString &pageObjName, const QString &groupObjName, QAction *action,int mode = 1) = 0;
    virtual void addSmallWidget(const QString &pageName, const QString &groupName, QWidget *widget) = 0;
    virtual void removeFrameAction(const QString &pageObjName, const QString &groupObjName, QAction *action) = 0;
    virtual void addActionPage(const QString &pageObjName) = 0;
    virtual void removeActionPage(const QString &pageObjName) = 0;
    virtual void addActionGroup(const QString &pageObjName, const QString &groupObjName) = 0;
    virtual void removeActionGroup(const QString &pageObjName, const QString &groupObjName) = 0;
    virtual int addFrameCenterWidget(QWidget *widget) = 0;
    virtual void removeFrameCenterWidget(QWidget *widget) = 0;
    virtual QDockWidget* addFrameDockWidget(QWidget* widget,Qt::DockWidgetArea area = Qt::LeftDockWidgetArea) = 0;
    virtual int addFrameDockCenterWidget(QWidget* widget) = 0;
    virtual QStackedWidget *getCenterWidget() = 0;
    virtual QMainWindow* getBaseWindow() = 0;
    virtual IDataManager* getDataManager() = 0;
};

#define IMainFrameService_iid "org.commonctk.service.imainframeservice"
Q_DECLARE_INTERFACE(IMainFrameService, IMainFrameService_iid)


#endif // IMAINFRAMESERVICE_H
